"""
    numpy 使用
"""

import numpy as np


# 一维数组

data = np.array([10,30,30])
print(data)
print("数组的维度",data.ndim)

# 返回一个 tuple,表示形状
print(f"data shape is : {data.shape}")
# 返回维度 1 的形状
print(data.shape[0])

# 二维数组
print("=============================================== ")
data = np.array([[1,3,4],[2,3,3]])
print(data)

print(f"data dim is : {data.ndim}")
print(f"data shape is : {data.shape}")
print(f"data first shape is : {data.shape[0]}")


# 矩阵的点乘
print("===================matrix==========================")
data1 = np.array([[1,3,4],[2,3,3]])
data2 = np.array([[1,2],[2,3],[3,4]])

# 一般来说顺序不能交换
result = np.dot(data1,data2)

print(f"the result is :{result}")

